import { cyHttp as http } from '@/services/http';
import type { OrderListParamsDto, OrderListDataDto, UpdateVipOrderDto, CreateVipOrderDto } from '@/types/api/crm-cy/order';

/** 列表 */
export const getList = (payload: { data: OrderListParamsDto; params: OrderListDataDto }) =>
  http({ url: '/api/admin/order/list', method: 'post', ...payload });

/** 编辑 */
export const updateOrder = (data: UpdateVipOrderDto) => http({ method: 'post', url: '/api/admin/order/update', data });

/** 编辑 */
export const createOrder = (data: CreateVipOrderDto) => http({ method: 'post', url: '/api/admin/order/create', data });

/** 订单退款 */
export const refundOrder = (id: number) => http({ url: `/api/admin/order/refund/${id}`, method: 'post' });
